import Foundation
import Flutter

class FlutterPluginDemoTextView: NSObject, FlutterPlatformView {
    let frame: CGRect
    let viewId: Int64
    let _label: UILabel

    init(_ frame: CGRect, viewId: Int64, args: Any?) {
        self.frame = frame
        self.viewId = viewId
        var text = "iOS UILabel"
        if (args is NSDictionary) {
            let dict = args as! NSDictionary
            text = dict.value(forKey: "text") as! String
        }

        let label = UILabel()
        label.textAlignment = .center
        label.text = text
        label.textColor = UIColor.black
        label.frame = self.frame
        label.font = label.font.withSize(30)

        _label = label
    }

    func view() -> UIView {
        self._label
    }
}
